const fs = require("fs");
const path = require("path");

const workerScript = fs
  .readFileSync(path.join(__dirname, "worker", "sql.worker.js"), "utf8")
  .toString();

const code = workerScript.match(/t\(\)\((.*),"Worker"/)[1];

fs.writeFileSync(
  path.join(__dirname, "src", "main", "worker.ts"),
  `export const workerCode:string = ${code}`
);
